package com.yuanfeng.goods.controller;


import com.yuanfeng.commoms.util.ResponseResult;
import com.yuanfeng.goods.dto.CartGuessLikeGoodsQueryDTO;
import com.yuanfeng.goods.dto.WapUserFootPrintDTO;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @ClassName GoodsUserFootprintController
 * @Description  商品访问足迹表
 * @Author cyp
 * @Date 2023-06-08 10:01:59
 * @Version 1.0
 **/
@RestController
@RequestMapping("goods/userFootprint")
public class GoodsUserFootprintController extends BaseController {

    /**
     * 查询购物车底部猜你喜欢
     * @return
     */
    @PostMapping("/cart/likeGoods/query")
    public ResponseResult queryCartGuessLikeGoods(@RequestBody CartGuessLikeGoodsQueryDTO param){
        ResponseResult result = goodsUserFootprintService.queryCartGuessLikeGoods(param);
        return result;
    }

    /**
     * 查询足迹
     *
     * @return
     */
    @PostMapping("/query")
    public ResponseResult queryFootPrint2(@RequestBody WapUserFootPrintDTO param) {
        ResponseResult result = goodsUserFootprintService.queryUserFoot(param);
        return result;
    }

    /**
     * 删除所有足迹
     *
     * @return
     */
    @PostMapping("/delete")
    public ResponseResult deleteFootPrint(@RequestBody Map<String, Object> map) {
        ResponseResult result = goodsUserFootprintService.deleteFootPrint(map);
        return result;
    }


    /**
     * 根据用户商品足迹 查询对应分类下的商品
     *
     * @return
     */
    @PostMapping("/queryUserRandomGoods")
    public ResponseResult queryUserRandomGoods(@RequestBody Map<String, Object> map) {
        ResponseResult result = goodsUserFootprintService.queryUserRandomGoods(map);
        return result;
    }
}
